home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / A / 4Plus 1.4.sit / 4Plus 1.4 / About 4Plus… < prev    next >
Encoding:
Text File  |  1990-12-26  |  67.6 KB  |  1,290 lines  |  [TEXT/KAHL]

  1. /* THE QUICK SKINNY ON 4PLUS...^1<I */
  2.  
  3. 4Plus is an INIT designed to enhance the THINK C editor.  It has been written to 
  4. be compatible with THINK C 4.0, and has proven to work with the 4.0.1 and 4.0.2 
  5. maintenance releases Symantec has subsequently made available.
  6.  
  7. This document is a THINK C text file, hence, I'm assuming you're reading it 
  8. using THINK C.  I'll also be assuming that you have the INIT installed - 
  9. obviously it's not necessary that you do but I'll be talking about the various 
  10. features as if you did.  It makes things easier for both of us.
  11.  
  12. /* The Options Menu */
  13.  
  14. Attached to the THINK C menu bar is a new menu titled ‘4Plus’, though I'll be 
  15. referring to it here on in as the options menu.  It should look something like 
  16. this...
  17.  
  18. Create Hierarchy
  19. Update Hierarchy
  20. Dispose Hierarchy
  21. -
  22. Trash Mark Keys
  23. Trash Mark Queue
  24. Trash Mark Stack
  25. Trash Scrap Stack
  26. Update "rsrc.h"
  27. Update "proj.π.rsrc"
  28. Version Territory…
  29. Preferences    >
  30.     Enable Tree Search
  31.     Cascading Progeny
  32.     Display Comment
  33.     Color Hiliting
  34.     Power Thumb
  35.     Prompt Keystroke
  36.     Meta-able Comments
  37. -
  38. Configure 4Plus…
  39. About 4Plus…
  40.  
  41. You should rarely need to use this menu.  It serves mainly as a dump for those 
  42. odd features/settings that didn't seem to belong anywhere else.  The only reason 
  43. I'm bringing it up now is because I'll be refering to it often throughout this 
  44. document and I don't want to have to break stride every time I do.  I'll also be 
  45. frequently referring to something I'm calling the configuration dialog - it can 
  46. be invoked by selecting the ‘Configure 4Plus…’ item from the options menu.
  47.  
  48. /* The Configuration Dialog */
  49.  
  50. When you look at the configuration dialog you're pretty much looking at 
  51. everything 4Plus can do.  4Plus functionality can be broken down into two 
  52. groups, those commands accessed by menus and those accessed via the keyboard.  
  53. The configuration dialog allows you to determine what event invokes what 
  54. command.  Let's start with the menus.
  55.  
  56.     /* Configuring The Menus */
  57.  
  58. When you select the menus portion of the configuration dialog, you end up with a 
  59. list that should look something like this...
  60.  
  61. Headers                cntl-cmd wInContent
  62. MacHeaders            opt wInDrag
  63. Methods                cntl-shift wInContent
  64. Methods, sorted        shift wInDrag
  65. Ancestry            cntl-opt-shift wInDrag
  66. Siblings            cntl-cmd-shift wInDrag
  67. Progeny                cntl-opt-cmd wInDrag
  68. Comments            cntl-cmd-shift wInDrag
  69. Omnibus                cntl wInContent
  70.  
  71. The events associated with each menu are a combination of a modifier key 
  72. combination and a WDEF partcode.  The modifier key combinations can range across 
  73. all possible permutations of the control, option, command, shift and caps lock 
  74. keys.  In the dialog, the different modifier keys are represented by icons 
  75. instead of words shown above... the icons are similar to those used by 
  76. MacroMaker.  The partcode corresponds to the result returned by a WDEF when 
  77. called with a wHit message.  For example, by looking at the list, we can see 
  78. that the headers menu can be invoked by depressing both the control and command 
  79. key while clicking in a window's content region.  For those unfamiliar with the 
  80. window partcodes, here they are...
  81.  
  82. wInGoAway            a click inside of the close box.
  83. wInZoomIn            a click inside of the zoom box.
  84. wInDrag                a click inside of the title bar, but not in any of the above.
  85. wInGrow                a click inside of the grow box.
  86. wInContent            a click inside of the window, but not in any of the above.
  87. wNoHit                a click outside of the window, and outside of the menu bar.
  88.  
  89. To change the way a menu is invoked, you select the menu in the list, depress 
  90. those modifier keys you want to use to invoke the menu, and click within the 
  91. appropriate window part as displayed in the little picture of a desktop to the 
  92. left of the list.  Let's say that all of the sudden I want to change the way the 
  93. headers menu is invoked.  Instead of having to hold down the control and command 
  94. keys while clicking in a window's content region, I want to just use the control 
  95. key while clicking in the window's title bar.  To do this, I select the headers 
  96. menu entry in the list by clicking on it, I depress the control key and I click 
  97. within the drag region of the windoid in the desktop picture to the left of the 
  98. list.  The list entry for the options menu should now look like this...
  99.  
  100. Headers                cntl wInDrag
  101.  
  102. The ability to customize the modifier key combinations allows 4Plus to be used 
  103. in conjunction with other INIT's that similarly abuse the modifier keys.  It 
  104. also allows users of non-ADB keyboards full access to all of the features 
  105. without penalizing the ADB keyboard owners.  Additionally, for the non-ADB 
  106. owners, an option exists wherein the caps lock key can be recognized as a 
  107. modifier key and subsequently used for a menu assignment.  Selecting the Caps 
  108. Lock check box will cause 4Plus to be caps lock sensitive, deselecting it causes 
  109. 4Plus to ignore the caps lock key.  The Caps Lock option can be used with ADB 
  110. keyboards as well, though there's less of a need to do so.
  111.  
  112.     /* Configuring The Keyboard */
  113.  
  114. When you select the keys portion of the configuration dialog, you end up with a 
  115. list part of which should look something like this...
  116.  
  117. ......
  118. Macro Record        esc
  119. Repeat                F15
  120. Stack Cut            F2
  121. Stack Copy            F3
  122. Stack Paste            F4
  123. Stack Dump            cntl F4
  124. ......
  125.  
  126. Pretty much the same concept as with the menus, only now we're no longer 
  127. interested in WDEF partcodes.  Associated with each command is a keystroke, 
  128. usually accompanied by one or more modifier keys.  For instance, we can see 
  129. above that the ‘Stack Dump’ command is invoked by pressing the control and F4 
  130. keys, simultaneously.  If we want to change it, we select the Stack Dump entry 
  131. in the list by selecting it, then invoke the new key sequence.  This should all 
  132. be very straightforward.
  133.  
  134. The keys portion of the configuration dialog lists all of the commands provided 
  135. by 4Plus.  There is, in addition, another section to the configuration dialog 
  136. that allows you to list macros (and the like) that you have defined, and through 
  137. which the macros may be reassigned to different key events in the same manner as 
  138. commands are.  We'll get to the guts of all of this later.
  139.  
  140.     /* More About The Configuration Dialog */
  141.  
  142. Some points regarding the configuration dialog...
  143.  
  144. When you assign an event to a command when that event is already assigned to 
  145. another command, the command that was previously associated with the event 
  146. becomes 'undefined' and the system will beep at you.  Currently, this is the 
  147. only way in which you can deassign a command.  Whether this is useful or not 
  148. depends on whether or not you want to disable any 4Plus commands.
  149.  
  150. Menu and key assignments are saved to disk and restored for subsequent sessions.
  151.  
  152. If, for whatever reason, you find yourself unable to call up the configuration 
  153. dialog from within THINK C, you can call it up from the Finder by double 
  154. clicking on the INIT itself with both the option and command keys depressed.  
  155. There shouldn't be any need to do so, as the configuration dialog is always 
  156. available from the options menu.
  157.  
  158. Use some common sense when assigning events.  As an example, a potential 
  159. conflict exists with the 'opt wInContent' assignment.  Remember that THINK C 
  160. looks for option modified clicks within the content region of it's windows.  If 
  161. after changing assignments you notice that THINK C isn't working like it used 
  162. to, chances are you've overridden a valuable THINK C feature with a 4Plus 
  163. feature.  Don't let this happen.
  164.  
  165. You'll need to refer to configuration dialog often throughout the rest of this 
  166. document to determine how to invoke the command being described.  I've 
  167. distributed 4Plus with a default set of key assignments that assumes you are 
  168. using an extended ADB keyboard - if you're not, you're going to have to adjust 
  169. some of the assignments so that they're accessible via the keyboard you are 
  170. using.
  171.  
  172. /* Menus In General */
  173.  
  174. 4Plus menus require that the frontmost window be a text window and have a 
  175. filename, i.e., the 4Plus menus will not work with untitled windows.  Most of 
  176. the menus require that the text window be either a source file (*.c) or a header 
  177. file (*.h).  Some of the menus require that the file must also have been added 
  178. to the current project and successfully compiled - and that the project's 
  179. reference to the file must be correct.  A file reference is information about a 
  180. source or header file that allows THINK C to quickly determine where the file is 
  181. located on the disk - this information is kept within the project file.  
  182. Generally, file references are always correct as THINK C will update this 
  183. information when executing certain commands (Run, Make, etc.).  If you should 
  184. move the project and/or it's files from one directory to another, or some such 
  185. similar operation, the file references will become invalid.  As 4Plus makes 
  186. extensive use of these file references, it is necessary that they be correct in 
  187. order for some 4Plus features to function.  If you are ever unable to invoke any 
  188. of these menus, invoke THINK C's Make dialog, deselect the Quick Scan check box, 
  189. click the Use Disk button and then the Make button.
  190.  
  191.     /* The Headers Menu */
  192.  
  193. The headers menu is exactly what THINK C has been offering since day one.  4Plus 
  194. doesn't change the menu or it's contents any - it just allows you to change how 
  195. it's invoked.  It can still be invoked via a click in the window's title bar 
  196. with either the option or command keys depressed - provided you haven't 
  197. overridden the combination with a 4Plus menu.  That's the only reason the 
  198. headers menu assignment is provided, to allow you to assign another menu in the 
  199. option or command key modifier slot when the mouse is clicked in the title bar.  
  200. Just in case you want to.
  201.  
  202. BTW, if you depress the option or command keys while clicking in the title bar 
  203. of the project window, you get a menu listing ALL headers included from ALL 
  204. source files within the project.  This is a THINK C feature, though one that I 
  205. believe is undocumented.
  206.  
  207.     /* The MacHeaders Menu */
  208.  
  209. The MacHeaders menu is to the headers menu what precompiled headers are to 
  210. normal headers.  Listed within the menu are the precompiled header files that 
  211. have been included in the current source file.  This will usually be MacHeaders, 
  212. however, it will work for a precompiled header file that has been explicitly 
  213. included as well (finally).  Selecting a item from the menu will open the 
  214. corresponding header file and display it within it's own window.
  215.  
  216. There are two caveats to this feature... the precompiled header file must be 
  217. precompiled while 4Plus is installed, and the source file from within which the 
  218. precompiled header file is included must have been successfully compiled at some 
  219. point.  Please read the last sentence again.  A good thing to do right now would 
  220. be to re-precompile MacHeaders.c, as well as any other precompiled headers you 
  221. use.  And again, don't forget that the source file from which the MacHeaders 
  222. menu is to be invoked from must be included in the current project and must have 
  223. been successfully compiled using the precompiled header.
  224.  
  225.     /* The Methods Menu */
  226.  
  227. The methods menu will display all of the methods, procedures and functions 
  228. defined within a source file (from hereon in, when I say method, I'm implicitly 
  229. referring to procedures and functions as well).  The source file need not have 
  230. been added to a project in order for the methods menu to work (it only needs to 
  231. have a filename ending in '.c').  Selecting a method from the menu will scroll 
  232. the window as appropriate to display the method, and hilight it's name.  As an 
  233. option, if the method is preceded by a comment, then the window will be scrolled 
  234. so as to display the comment as well.  This can be controlled via the options 
  235. menu by selecting the ‘Display Comments’ item.
  236.  
  237. In order to operate correctly, the source file should be reasonably free of 
  238. syntax errors, in particular - brackets, comment delimiters, parentheses, single 
  239. and double quotes should all be balanced correctly.  If not, the methods menu 
  240. will take note of the error and insert a ‘syntax error’ item in the menu.  
  241. Choosing this item will scroll the window so as to display the line in which the 
  242. imbalance was detected and place the insertion point at the line's beginning.  
  243. Note that this isn't necessarily where the imbalance is to be remedied.
  244.  
  245. I have tested the methods menu on all of the source files in the THINK Class 
  246. Library as well as all of the winning entries in the Obfuscated C Contest from 
  247. 1984 through 1988 inclusive.  I even tested it on my code.  It worked with all 
  248. of the above, with the exception of a few of the Obfuscated C entries that 
  249. insisted on using the preprocessor to redefine various delimiters.  For example:
  250.  
  251. #define IF    if (
  252. #define THEN    ){
  253. #define AND    ;
  254. #define END    ;}
  255.  
  256. IF a != b THEN a = a + b AND b = 0 END
  257.  
  258. IF this is your coding style THEN you will not want to use 4Plus END (or at 
  259. least not the methods menu).  In order to correctly parse this kind of 
  260. construct, it would be necessary to pull in all of the source file's includes.  
  261. It would also be necessary to actually look at every token that comes in as well 
  262. as maintaining a greater sense of context as the file is parsed, all of which 
  263. would slow things down to the point where it would be faster to just scroll 
  264. through the document yourself.  That it is this way is likely the reason why 
  265. such a feature was never included within THINK C to begin with... consistency is 
  266. surely of greater value than convenience.
  267.  
  268. Just when I was feeling really good about the algorithm used to parse methods, I 
  269. did this...
  270.  
  271. int (*foo(int foobar))
  272. {
  273.         /* obnoxious code */
  274. };
  275.  
  276. 4Plus thinks this function is called ‘void’.  ARRGH!  This is a bug.  If you 
  277. can, use typedef's when you're anticipating the need for writing functions that 
  278. return pointers to functions.  That's what THINK C does (look at the declaration 
  279. for signal).  That's what typedef's are for.  All this embarrassment could have 
  280. been avoided had I done this instead...
  281.  
  282. ProcPtr foo(int foobar)
  283. {
  284.         /* clean, easy to maintain code */
  285. }
  286.  
  287. The methods menu will display the methods in the order in which they are 
  288. declared in the source file.  The method in the source file that contains the 
  289. insertion point (or the beginning of an extended selection) is deemed to be the 
  290. currently selected method, and as such the corresponding item in the methods 
  291. menu will be hilited when the methods menu is invoked.
  292.  
  293.     /* The Sorted Methods Menu */
  294.  
  295. The methods menu has a companion, the sorted methods menu.  This menu is 
  296. identical to the methods menu except that the methods are sorted alphabetically 
  297. when displayed in the menu.  Sometimes this is nice.
  298.  
  299.     /* The Ancestry, Siblings & Progeny Menus */
  300.  
  301. The ancestry, siblings and progeny menus are best treated as if they are one.  
  302. They are of use only if you are using the object oriented extensions made 
  303. available with THINK C 4.0.  These menus may be invoked from any source file 
  304. containing the method definitions for a class, or from any header file 
  305. containing a class definition.  The source file or header file from within which 
  306. the menus are to be invoked should have been added to the project file.
  307.  
  308.         /* The Ancestry Menu */
  309.  
  310. The ancestry menu will display all of the classes in the given class's ancestry, 
  311. i.e., it will display the given class's superclass, followed by the superclass's 
  312. superclass, and so on, until the root class for the given class is displayed.
  313.  
  314.         /* The Siblings Menu */
  315.  
  316. The siblings menu will display all classes who share the same superclass as the 
  317. given class.
  318.  
  319.         /* The Progeny Menu */
  320.  
  321. The progeny menu will display all subclasses of the given class, and optionally 
  322. will display all subclasses of the subclasses, and their subclasses, and so on, 
  323. until there are no more subclasses (more on this later).
  324.  
  325.         /* How To Use These Menus */
  326.  
  327. Selecting a class from any of the menus will in turn open the file corresponding 
  328. to the class.  If the menu was invoked from within a source file, the selected 
  329. class's source file will open, if invoked from within a header file, the 
  330. selected class's header file will open.  For source files, if you continue to 
  331. depress the modifier keys used to invoke the menu after making a selection, 
  332. 4Plus will take note of the currently selected method (same definition as in the 
  333. methods menu).  Then when the selected class is opened, 4Plus will look to see 
  334. if that method is defined within the selected class, and if it is, the method 
  335. gets displayed in the same fashion as if you had used the methods menu to 
  336. display it.  If the selected class doesn't contain the method, 4Plus will still 
  337. remember the selected method, thus allowing you to repeat the process.  The 
  338. selected method is remembered until you change the selection point in any 
  339. document, either by clicking in a document, typing, doing a scrap operation, 
  340. etc.
  341.  
  342. Taken together and when properly understood and used, these menus can make for a 
  343. most effective browsing utility.  However, there are some things you have to 
  344. keep in mind as you use them.  4Plus determines the class hierarchy for a 
  345. project based on the class definitions in a project's header files.  The header 
  346. files that contain the class definitions need to be named after the source files 
  347. that contain the method definitions for the class (i.e., CFoo.c and CFoo.h).  
  348. This is in keeping with the style THINK C recommends for setting up classes, and 
  349. is how the THINK Class Library is itself put together.  Note that the file name 
  350. doesn't necessarily have to begin with a 'C'.
  351.  
  352.         /* Establishing The Hierarchy */
  353.  
  354. Additionally, 4Plus needs to scan through the project before any of the menus 
  355. can be invoked.  It needs to do this so as to establish a project's hierarchy, 
  356. and it needs for you to tell it when to perform the scan.  This is accomplished 
  357. via the options menu using the ‘Create Hierarchy’, ‘Update Hierarchy’, and 
  358. ‘Dispose Hierarchy’ commands.
  359.  
  360.             /* Create Hierarchy */
  361.  
  362. The ‘Create Hierarchy’ command is basically a short cut, it just does a ‘Dispose 
  363. Hierarchy’ followed by an ‘Update Hierarchy’.
  364.  
  365.             /* Update Hierarchy */
  366.  
  367. ‘Update Hierarchy’ looks through the project file and examines each reference to 
  368. a source file it encounters.  If the source file is found to include a header 
  369. file by the same name, then the class hierarchy that 4Plus maintains is examined 
  370. to determine whether an entry already exists for this class.  If not, the header 
  371. file is scanned for a class definition.  If a class definition is found, entries 
  372. are made for the class and it's superclass (if there exists more than one class 
  373. definition within a header file, only the first applies).
  374.  
  375.             /* Dispose Hierarchy */
  376.  
  377. ‘Dispose Hierarchy’ does just that, it disposes all class entries for a project.  
  378. Note that it disposes only the entries 4Plus maintains internally, NOT your 
  379. source code or any of your header files or anything else of value.
  380.  
  381. Generally, you'll invoke the ‘Create Hierarchy’ command when you first introduce 
  382. 4Plus to a project.  Thereafter, use ‘Update Hierarchy’ whenever you add 
  383. classes.  The only time you'll need to again invoke the ‘Create Hierarchy’ 
  384. command is when you either delete a class or change an existing classes' 
  385. ancestry.
  386.  
  387. If you're ever in doubt, just use ‘Create Hierarchy’.  Parsing a project doesn't 
  388. take all that long, and you'll be assured of a complete and accurate 
  389. representation of the project's hierarchy.
  390.  
  391.         /* Possible Problems */
  392.  
  393. Generally, you'll want the file references contained within the project to be 
  394. correct when creating and using the hierarchy menus.  If any of the menus fail 
  395. to appear or seem to be missing classes, you probably need to update your 
  396. project.
  397.  
  398. There are instances when THINK C doesn't provide the kind of information 4Plus 
  399. needs in order to establish the hierarchy.  Specifically, if you are utilizing 
  400. THINK C's #define _H_filename feature within your header files, AND you have 
  401. taken to precompiling some or all of the header files containing class 
  402. definitions, 4Plus will not be able to use the project file to determine whether 
  403. or not a given source file has a header file with the same name and where that 
  404. header file resides.  It does no good to "re-include" a header file that has 
  405. been precompiled within it's associated source file.  The only solution in this 
  406. case is to force 4Plus to go into HFS Cruise Mode™ and try to find the header 
  407. file on it's own.
  408.  
  409.         /* The Enable Tree Search Command */
  410.  
  411. Located within the options menu is an item entitled ‘Enable Tree Search’.  When 
  412. this item has a check next to it, 4Plus, when creating or updating the class 
  413. hierarchy, will try to locate the header file utilizing information contained 
  414. within the project file.  If it cannot find the information it needs, 4Plus will 
  415. resort to searching the project tree, and then the THINK C tree, for a header 
  416. file it thinks it needs.  Note that the project tree and the THINK C tree are 
  417. searched in that order, and that 4Plus will omit directories whose names are 
  418. surrounded with brackets (unless the name for the directory minus the brackets 
  419. is the same as the name for the project) just like THINK C does it.  If and when 
  420. 4Plus finds the header file, all is well and things go back to normal.
  421.  
  422. 4Plus uses the search trees in very much the same manner as THINK C, hence, the 
  423. THINK C documentation regarding use of these trees applies to 4Plus as well.  
  424. There is one difference however relating to the order in which the trees are 
  425. searched.  4Plus will always search the project tree before the THINK C tree.  
  426. This can cause problems if the header file 4Plus is looking for resides in both 
  427. trees, and the version you want to use is in the THINK C tree.  So beware.
  428.  
  429. The bad news about this whole tree search business is that doing a ‘Create 
  430. Hierarchy’ will take longer due to the added file IO overhead.  If you find 
  431. yourself having to enable the tree search for your project, you'll be sure to 
  432. want to use the ‘Update Hierarchy’ command instead of the ‘Create Hierarchy’ 
  433. command whenever possible.
  434.  
  435. The good news is that a source file containing the method definitions for a 
  436. class need not be successfully compiled in order for it to be displayed in the 
  437. hierarchy menus.  It need only be added to the project.  Depending on what stage 
  438. you are in with a project and your coding style, this can be a truly good thing.
  439.  
  440.         /* Hierarchical Menu Anxiety */
  441.  
  442. One last thing I want to touch on with regards to the hierarchy menus has to do 
  443. with the progeny menu in particular.  There's an item in the options menu called 
  444. ‘Cascading Progeny’.  It is initially unchecked.  In this state, you will only 
  445. be able to display those classes which are a direct subclass of a given class.  
  446. Choose ‘Cascading Progeny’ places a check next to the item, and thus allows you 
  447. to display subclasses of subclasses of subclasses and so on.  There are a number 
  448. of problems with this however.
  449.  
  450. The first problem has to do with the fact that hierarchical menus can nest only 
  451. five deep.  Thus, subclasses of a subclass that's a subclass of the subclass 
  452. whose class is a subclass of a given class's subclass won't be displayed.  If 
  453. that doesn't bother you, then so far so good.
  454.  
  455. The second problem has to do with the fact that we can only have up to 256 
  456. hierarchical and popup menus at any one time.  This is made worse by THINK C and 
  457. 4Plus having other popup menus and by using some of these precious ID's for 
  458. their own non-hierarchical menus.  This puts a hard limit on just how big a 
  459. project can be, though when you think about it, this shouldn't be a problem for 
  460. any but the most gigantic projects.  If a project has more than, say, 230 
  461. classes that have subclasses, then the results when using 4Plus to display a 
  462. class's progeny will be incomplete.  If you're project doesn't (Art Class has 
  463. only 33), then there isn't any problem.
  464.  
  465. The third (and last, I think) problem is purely aesthetic.  When you select a 
  466. subclass that itself has subclasses, you don't get that nice blinking effect as 
  467. a visual confirmation that the item was chosen.  Instead, the menu just 
  468. disappears, immediately.  I personally find this disconcerting, but you may not.  
  469. This violates Apple's idea of how things should work, but sometimes it pays to 
  470. break the rules.
  471.  
  472. I know that there are those who think that hierarchical menus are easily the 
  473. most abused user-interface element on the Mac and who will be howling and 
  474. hooting as they play around with the progeny menu.  I will agree that the use of 
  475. hierarchical menus for the sake of using same is not a good thing, or that the 
  476. use of hierarchical menus to shy away from putting together a real interface is 
  477. not a good thing, but I have to disagree when it comes to using hierarchical 
  478. menus to display something that is truly hierarchical in nature.  The class 
  479. hierarchy definitely qualifies in this regard, and furthermore, this is an INIT.  
  480. This is not PageMaker.  When you're looking to provide maximum functionality 
  481. with the minimum of coding and the minimum of impact on your host application, 
  482. hierarchical popup menus become an acceptable solution.
  483.  
  484.     /* The Comments Menu */
  485.  
  486. This menu will simply display the C-style comments contained in a text file.  If 
  487. you are reading this using THINK C and you have 4Plus installed, you can see 
  488. what I mean by depressing the option, command and shift keys while clicking in 
  489. the window's title bar (unless you've changed the assignment).  Selecting a 
  490. comment from the menu in turn scrolls the window so as to display the comment, 
  491. and the comment's text is highlighted.
  492.  
  493. The menu will not attempt to display comments that span over multiple lines.  
  494. Excess asterisks and any white space following and/or preceding the comment 
  495. delimiters is stripped out (of the menu).  The opening comment delimiter must 
  496. either start a line of text, or be preceded by one or more tab characters.  The 
  497. tab characters can be used to create a hierarchical menu, as was done in this 
  498. document - though if the number of tabs preceding a comment exceeds the number 
  499. of tabs preceding the preceding comment by two or more the comment will not be 
  500. displayed.
  501.  
  502. Within the options menu there is an item titled “Meta-able Comments”.  This 
  503. controls whether how 4Plus creates the menu.  When “Meta-able Comments” is 
  504. active, 4Plus simply uses the Menu Manager's AppendMenu routine, which will take 
  505. the comment text and look for any meta-characters that may reside within (I 
  506. assume you know what a meta-character is).  Deselecting the option causes 4Plus 
  507. to use SetItem instead - hence, no meta-characters.  You can spruce up the 
  508. comments menu by appending an appropriate meta-character set to one or more of 
  509. your comments - I don't know, maybe you want some comments to stand out more 
  510. than others.  Contained within 4Plus are nine 'ICON' resources with id's 257 
  511. through 265... they may be used for meta-character sequences ^1 through ^9, and 
  512. of course you can change them as you'd like (well, most of them... leave ID 257 
  513. alone, I'm using it elsewhere).
  514.  
  515. Here's an example.
  516.  
  517.         /* Items with icons */
  518.             /* 4Plus^1 */
  519.             /* You should know what this is^2 */
  520.             /* THINK C Debugger^3 */
  521.             /* THINK C Text File^4 */
  522.             /* Lé Mac^5 */
  523.             /* Jack in the Mac^6 */
  524.             /* Talking in 1 pt Helvetica^7 */
  525.             /* Road Sign^8 */
  526.             /* I stole this from HyperCard^9 */
  527.  
  528.         /* Items with marks */
  529.             /* Opt-shift K or Cntl T! */
  530.             /* Cntl R! */
  531.             /* Cntl S! */
  532.             /* Opt 5!∞ */
  533.  
  534.         /* Items with style */
  535.             /* Bold<B */
  536.             /* Italic<I */
  537.             /* Underline<U */
  538.             /* Outline<O */
  539.             /* Shadow<S */
  540.  
  541.         /* Ignored Keyboard equivalent/? */
  542.  
  543.         /* (Disabled */
  544.  
  545.         /* Notice that 4Plus won't allow; multiple items */
  546.  
  547.  
  548. The comment menu doesn't require anything of the window from within which it is 
  549. invoked.  Earlier on, I said that all of the 4Plus menus would not work with 
  550. untitled windows.  I lied.  Also note that the previously stated reservations 
  551. relating to the overuse of hierarchical menus applies here as well.
  552.  
  553.     /* The Omnibus */
  554.  
  555. This menu is simply all of the above menus put into one.  Well, not all of the 
  556. menus... the normal methods menu won't appear, though it's counterpart the 
  557. sorted methods menu will, and the headers menu is omitted as well - since it's 
  558. really THINK C who's responsible for that.  The benefit with using the omnibus 
  559. menu is that you don't have to remember a bunch of modifier key/window 
  560. partcode/planetary alignment combinations in order to get a 4Plus menu up on the 
  561. screen.  The downside with the omnibus menu is that 4Plus has to create ALL of 
  562. the menus at once, and depending on your system and project size the delay may 
  563. be unacceptable.
  564.  
  565.  
  566. /* Key Commands */
  567.  
  568. There are two basic groups of key commands provided with 4Plus... key commands 
  569. that actually do something THINK C previously couldn't, and key commands that 
  570. let you reassign key sequences for things THINK C already knew how to do.  The 
  571. latter are provided primarily for those with non-ADB keyboards.  Unless 
  572. otherwise specified, all of the key commands will work with any text window, 
  573. whether it has been saved or not.  The flip side to that is that there has to be 
  574. at least one text window open in order for any of the key commands to be 
  575. recognized by 4Plus.  Key commands, like 4Plus menus, can be reassigned to 
  576. respond to different events.  Additionally, 4Plus will recognize an assignment 
  577. make from the keypad (i.e., you can assign a command to ctrl-'1' twice, one for 
  578. the ctrl-'1' generated from the keyboard and one for the ctrl-'1' generated from 
  579. the keypad).  I'm going to describe the different commands in an order somewhat 
  580. reflective of my ability to remember them all.  Again, you'll need to refer to 
  581. the dialog in order to determine how a given command is invoked.
  582.  
  583.     /* Configure */
  584.  
  585. This assignment is the same thing as choosing Configure 4Plus… from the options 
  586. menu.  A convenience.
  587.  
  588.     /* Examine Assignment */
  589.  
  590. Invoking this command makes 4Plus wait for a key event.  When it gets one, it 
  591. looks to see if there are any commands, macros, etc., which are assigned to the 
  592. event.  If there are, you'll get a dialog box displaying information appropriate 
  593. to the assignment.  For commands, this consists of nothing more than a short 
  594. text description of what the command is supposed to do.  For macros, you'll get 
  595. a dialog that will allow you to view and edit both the macro's name as well as 
  596. the key events which make it up.  For searches, you'll get a dialog similar to 
  597. THINK C's Find dialog.  And finally for saved window positions, you'll get yet 
  598. another dialog that will allow you to change the saved position.
  599.  
  600. In the event there are no 4Plus assignments for a given key event, you'll just 
  601. get a beep.
  602.  
  603.     /* Save Search */
  604.  
  605. This allows you to save searches.  After invoking this command, press whatever 
  606. key you want a search to be assigned to.  Whatever THINK C was set to search for 
  607. has now been saved and can be performed by simply pressing the key you assigned 
  608. the search to.  Most all of what THINK C was set to search for is saved... the 
  609. search string, the replace string, matching words, case sensitivity, wrap 
  610. around, as well as whether it was a grep expression.  The only settings that 
  611. aren't saved are global search settings.  Sorry.
  612.  
  613. The usefulness of this feature should be obvious.  It makes macros truly useful.  
  614. And it's a great timesaver.
  615.  
  616. Searches are displayed along with macros in the configuration dialog.  Double 
  617. clicking on a search assignment will open a dialog box in which you can edit the 
  618. search... it's the same dialog you get from the ‘Examine Assignment’ command.
  619.  
  620.     /* Save Window Position */
  621.  
  622. 4Plus allows you to save window positions.  After invoking this command, press 
  623. whatever key combination you want the frontmost window's position to be assigned 
  624. to.  The window position will then be assigned to this key event.  Pressing the 
  625. key you assigned the window position to will now position the frontmost window 
  626. to the saved position.  What I wanted to do was provide a mechanism with which I 
  627. could press a key and have a source file and corresponding header file viewable 
  628. at the same time, without having to play 'Mouse Wars'.  So I defined a macro 
  629. that repositions the frontmost window, opens (or selects) the windows 
  630. corresponding header file (or source file if the window contained a header 
  631. file), and repositions that window below the other.
  632.  
  633. When you invoke the ‘Examine Assignment’ command on an assignment for a saved 
  634. window position, you get a dialog that displays a miniature representation of 
  635. the desktop, along with a scaled representation of a window in the saved 
  636. position.  You can move and resize the window from within the dialog, and the 
  637. changes will be saved for the assignment.
  638.  
  639.     /* Enter Selection to Replace */
  640.  
  641. This command behaves like THINK C's ‘Enter Selection’ command, only that the 
  642. selection is entered as the replacement text instead of the search text.  One 
  643. difference between the two is that THINK C will switch out of Grep mode when you 
  644. do an ‘Enter Selection’, whereas 4Plus doesn't bother.
  645.  
  646.     /* Match Words, Wrap Around, & Ignore Case */
  647.  
  648. All these commands do is toggle the setting that previously was only toggleable 
  649. from THINK C's Find dialog.  The idea here is was to avoid having to make a trip 
  650. to THINK C's Find dialog after doing a Enter Selection command just because one 
  651. of these settings wasn't right.  To be perfectly honest, I haven't found myself 
  652. making a whole lot of use of it.
  653.  
  654.     /* Macro Record */
  655.  
  656. This command delimits those keystrokes that are to be recorded as a macro.  A 
  657. macro can consist of any number of keystrokes, and may optionally invoke other 
  658. macros, command key equivalents for the THINK C menus, or even macros defined 
  659. from within other macro utilities (depending on your macro utility).  The idea 
  660. with the 4Plus macro utility is to make defining and invoking a macro as simple 
  661. and as quick as possible.  It isn't intended as a replacement for QuicKeys as 
  662. the like, as the domain is pretty much restricted to text manipulation - and it 
  663. is also important to recognize that I may be taking some liberties with the term 
  664. “macro” - there is no facility for conditionals or argument substitution or any 
  665. of that kind of stuff.  The 4Plus macro utility works like this...
  666.  
  667. Invoke the ‘Macro Record’ command.  The cursor will change to a miniature 
  668. version of the 4Plus ICON to let you know that macro recording is on.  Type in 
  669. whatever comes to mind.  Invoke the ‘Macro Record’ command again.  The cursor 
  670. will resume a normal appearance letting you know that macro recording is off.  
  671. Now press whatever key you want the macro to be assigned to.  The function keys 
  672. on the extended ADB keyboard are good for this, but any modifier key/normal key 
  673. combination will do.
  674.  
  675. We now have a working macro.  You invoke it by pressing the key combination you 
  676. assigned to it.  The macro will be saved and will be available for use in 
  677. subsequent sessions.
  678.  
  679. If you invoke the ‘Macro Record’ command twice, the next key combination you 
  680. enter will be deassigned if it was previously assigned to a macro (or a search, 
  681. or a window position).  If it wasn't previously assigned nothing will happen.  
  682. If you invoke ‘Macro Record’ twice while recording a macro, the recording will 
  683. be aborted and no assignment will be made.
  684.  
  685. A macro key assignment will override a THINK C menu's command key equivalent and 
  686. a 4Plus key command, but not another macro utilities key assignment (depending 
  687. on the macro utility).
  688.  
  689. As I mentioned, a macro can itself invoke another macro.  The limit on macro 
  690. nesting is set at 16.  A limit is necessary, as the following scenario will 
  691. demonstrate.
  692.  
  693. Say you define the F5 key to play back the characters 'bar'.  Then you define 
  694. the F6 key to play back the characters 'Foo', followed by the F5 key.  So now 
  695. when you invoke the F6 key, you get 'Foobar'.  Now you redefine the F5 key to 
  696. play back the characters 'bar', followed by the F6 key.  Hmmm.  Invoking the F6 
  697. key plays back the characters 'Foo', and invokes the F5 key, which plays back 
  698. the characters 'bar', and invokes the F6 key, which plays back the characters 
  699. 'Foo', and invokes the F5 key, which plays back the characters 'bar', and 
  700. invokes the F6 key, which plays back the characters 'Foo', and invokes the F5 
  701. key, and so on.  Without a nesting limit, this would continue until we either 
  702. ran out of memory or out of patience.
  703.  
  704. Anyhow, whenever a macro is running you can always abort it by doing a command 
  705. period.  In fact, any time you're running a macro you should be poised to do a 
  706. command period as sometimes macros can do things you weren't interested in 
  707. having them do.  Testing the macro utility was a lot of fun.
  708.  
  709. Certain commands will automatically abort a macro.  For instance, any cursor key 
  710. operation that should change the selection range but doesn't will abort a macro.  
  711. Any error condition detected by 4Plus will abort a macro.  Other 4Plus commands 
  712. will abort a macro in situations peculiar to themselves... they are listed where 
  713. appropriate in the commands description.
  714.  
  715. Macros can be reassigned to different keys just like commands.  Call up the 
  716. configuration dialog and select the radio button titled ‘Macros’.  A list of all 
  717. macro assignments will be generated, as well as search assignments and window 
  718. positions.  Each assignment may optionally have a name associated with it if it 
  719. should be that you've assigned one to it.  Select one and you can enter a new 
  720. assignment.  Double click on one and you get a dialog box from within which you 
  721. can edit the macro, as well as enter a name for it.  This is the same dialog 
  722. that you get when you do an ‘Examine Assignment’.
  723.  
  724.     /* Repeat */
  725.  
  726. Closely related to the macro facility is the “Repeat” command, which is provided 
  727. for those instances where you want a given key sequence to be repeated over and 
  728. over again.  Though ‘Repeat’ is generally used with 4Plus macros, it can be used 
  729. with THINK C command key equivalents as well.  All you do is invoke the ‘Repeat’ 
  730. command and then enter a key combination you want to have repeated.  And it is.  
  731. Over and over.  Relentlessly.  Until you either do a command period, or, in the 
  732. case of some of the 4Plus key commands to be described later, the repeated 
  733. command cannot be performed.
  734.  
  735. So in the preceding example on macro nesting, it looks like what we wanted to 
  736. have happen was for the word 'Foobar' to continuously repeat itself.  An 
  737. interesting coding style, to be sure.  I think we can all agree that the proper 
  738. way to do this would be to set up a macro to play back the characters 'Foobar', 
  739. invoke the ‘Repeat’ command, and then invoke the macro.
  740.  
  741. FoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobarFoobar
  742.  
  743. A note on the ‘Repeat’ command.  If used before invoking a macro, issuing a 
  744. command period will abort the repeat process, however, the macro being repeated 
  745. will be allowed to finish it's playback.  This is a feature.  If you want to 
  746. abort both, issue the command period sequence twice.  It is possible to record 
  747. the ‘Repeat’ command within a macro, and for that macro itself to have been 
  748. repeated from within yet another macro which was itself invoked after invoking 
  749. the ‘Repeat’ command.  In such an instance, it may be necessary to issue a whole 
  750. bunch of command periods if you want the thing to stop.
  751.  
  752.     /* Marks */
  753.  
  754. A mark, in 4Plus, is a position within a file.  A mark contains information that 
  755. associates it with a window, and with a selection range within that window.  
  756. 4Plus allows you to save and restore marks, and it allows you to do so with some 
  757. flexibility.  This is useful in instances where you are working on many parts of 
  758. a project or a file simultaneously and you want to be able to goto these 
  759. different parts quickly and with a minimum of fuss.  A mark survives only as 
  760. long as the window to which it is associated remains open... once you close the 
  761. window, the mark is deallocated.  Additionally, if you revert a file to the last 
  762. saved version any marks associated with the file are deallocated as well.  A 
  763. mark is also removed when the text associated with the mark is deleted or 
  764. replaced.
  765.  
  766.         /* The Mark Keys */
  767.  
  768. The most basic mark mechanism allows you to assign individual marks to 
  769. individual keys.  The ‘Assign Mark’ command will prompt you for an individual 
  770. key (as opposed to a modifier key combination).  The key you then enter will be 
  771. assigned to the current window and selection range.  Invoking the ‘Goto Mark’ 
  772. command followed by the assigned key will then select that window (in the case 
  773. where it is not frontmost when the command was invoked), restore the selection 
  774. range, and then scroll the window so that the selection range is visible.  
  775. Assigning a mark to a key that already has a mark will replace the old mark with 
  776. the new one.
  777.  
  778.         /* The Mark Queue */
  779.  
  780. The mark queue is a queue consisting of one or more marks.  When using the queue 
  781. there is always a current mark... it may either be the last mark entered or the 
  782. last mark accessed.  New marks are always entered into the queue following the 
  783. current mark.
  784.  
  785. The ‘Mark Position’ command enters the current window and selection range into 
  786. the mark queue.  If the queue already contains one or more marks, the mark is 
  787. entered after the current mark, otherwise it becomes the first mark in the 
  788. queue.  In either case, the mark becomes the current mark.
  789.  
  790. The ‘Previous Mark’ command will do one of two things.  If the current selection 
  791. range/and or frontmost window is different from that stored as the current mark, 
  792. the current mark will be displayed, otherwise the mark preceding the current 
  793. mark in the mark queue becomes the current mark and it is displayed.  ‘Next 
  794. Mark’ displays the mark inserted after the current mark, which then becomes the 
  795. current mark.   Again, for both commands, if the window in which the new current 
  796. mark is set is not the foremost window, it is selected, and if the marked 
  797. position is not visible in the window, the window is scrolled so as to display 
  798. the mark.  The selection range is then restored to what it was when the mark was 
  799. entered into the queue.  If the current mark is deleted, the previous mark 
  800. becomes the current mark, unless there is no previous mark, in which case the 
  801. next mark becomes the current mark.
  802.  
  803.         /* The Mark Stack */
  804.  
  805. If the mark queue sounds a little convoluted, there's something called the mark 
  806. stack that can be used instead.  The name should say it all, but I'll try to 
  807. explain it anyway.  The mark stack is a stack of marks, and the current mark is 
  808. always the last mark entered on the stack.  ‘Push Mark’ 'pushes' a mark on to 
  809. the mark stack.  This mark becomes the current mark, and may be accessed via the 
  810. ‘Pop Mark’ command.  Once you do a ‘Pop Mark’, the popped mark is deallocated 
  811. and is no longer available.  The mark stack is most useful when used in macros, 
  812. due to their transitory nature.
  813.  
  814. You'll probably need to play with the mark queue and the mark stack a little to 
  815. better understand what I'm talking about.  The idea is that you can mark the 
  816. position in a text window in which you are currently working, scroll to another 
  817. part of the document or open or select another document, make whatever changes 
  818. you want, and quickly pick up where you left off by displaying the current mark.  
  819. For large documents or for those heavy duty editing sessions, you can arrange 
  820. virtually any number of marks spanning multiple documents and go from mark to 
  821. mark with a key press.  Marks entered via the mark queue, mark stack and mark 
  822. keys mechanisms are all independent of one another, that is, you can intersperse 
  823. marks throughout a project using any or all of the above methods without 
  824. affecting the status of any of the others.
  825.  
  826. To dispose of all of the marks assigned via the ‘Mark Keys’ mechanism, select 
  827. ‘Trash Mark Keys’ from the options menu.  ‘Trash Mark Queue’ does the same thing 
  828. for the mark queue, and ‘Trash Mark Stack’ likewise for the mark stack.  Again, 
  829. it is important to note that all marks for a window are removed when the window 
  830. is closed, or when you choose Revert from THINK C's File menu for a window.  A 
  831. mark is also removed when the text associated with the mark is deleted or 
  832. replaced.  If you attempt to select a mark using any of the above commands, and 
  833. there is no such mark to go to, 4Plus will emit a beep, and if the command was 
  834. invoked by a macro and there is no mark to go to, the macro playback is aborted.
  835.  
  836.     /* The Scrap Stack */
  837.  
  838. The ‘Stack Cut’, ‘Stack Copy’, ‘Stack Paste’ and ‘Stack Flush’ commands all deal 
  839. with something called the scrap stack.  The name should pretty much say it all.  
  840. The scrap stack complements the normal scrap - the cut, copy and paste commands 
  841. as implemented by THINK C still do exactly what they did before.  When you do a 
  842. ‘Stack Cut’ or ‘Stack Copy’, the contents of THINK C's scrap are copied to the 
  843. stack scrap, and then the cut or copy is performed normally.  When you do a 
  844. ‘Stack Paste’, the scrap is pasted into the document, and the last entry in the 
  845. stack scrap then replaces THINK C's scrap.  There is no predefined limit as to 
  846. how many entries may exist within the stack, available memory is the only 
  847. constraining factor.  The ‘Stack Flush’ command will take all of the entries in 
  848. the scrap stack, concatenate them, place the result in THINK C's scrap, and 
  849. perform a paste with the new contents of the scrap.  The scrap stack is then 
  850. deleted.
  851.  
  852. If you invoke the ‘Stack Paste’ or ‘Stack Flush’ commands when the scrap stack 
  853. is empty, 4Plus will emit a beep, and if these commands were invoked via 
  854. playback of a macro the playback is aborted.
  855.  
  856. A little common sense is in order when using the scrap stack.  You shouldn't use 
  857. it for storing multiple selections of an unusually large size.  The code in 
  858. 4Plus is sensitive to memory use and won't do anything stupid if a stack 
  859. operation can't be performed due to lack of memory, but it's not the purpose of 
  860. the scrap stack to be used in this manner.  If you want to deallocate the scrap 
  861. stack for any reason, choose ‘Trash Scrap Stack’ from the options menu.  Note 
  862. that for use in macros, a ‘Trash Scrap Stack’ key command is provided as well.  
  863. Neither will affect the normal scrap.  Also note that the scrap mechanism used 
  864. by THINK C limits the size of the scrap to 32K... so each entry in the scrap 
  865. stack is limited to the same size.  The total size of all entries in the scrap 
  866. stack can exceed 32K of course, but then you'll get undefined results when 
  867. performing a ‘Stack Flush’.
  868.  
  869.     /* Scrap Swapping */
  870.  
  871. Related to the scrap stack is the ‘Scrap Swap’ key command.  A ‘Scrap Swap’ 
  872. merely exchanges the contents of the scrap with the current selection in the 
  873. foremost text window - the selected text is copied into a separate buffer, the 
  874. scrap replaces the selected text, and the text in the separate buffer replaces 
  875. the scrap.
  876.  
  877.     /* UPPER And lower Case */
  878.  
  879. The ‘Upper Case’ command coerces all selected lower case text to be upper case.  
  880. Vice versa for the ‘Lower Case’ command.
  881.  
  882.     /* Opening Headers */
  883.  
  884. The ‘Open Header/Source’ command does exactly that.  It takes the name of the 
  885. frontmost document and determines if it is a source file or a header file (*.c 
  886. vs. *.h).  For source files, it looks for a header file with the same name and 
  887. opens it (foo.c opens foo.h).  Vice versa for header files.  This is good for 
  888. macros.
  889.  
  890.     /* Token Selection */
  891.  
  892. The ‘Token Left’, ‘Token Right’, ‘Select Left Token’ and ‘Select Right Token’ 
  893. key commands all operate on tokens in the same way the left and right arrow keys 
  894. operate on characters.  There are three types of tokens - those character 
  895. sequences made up of those characters allowed in C variable names, white space 
  896. characters, and everything else.  Note that this is similar to effect achieved 
  897. by double clicking on a token, though only C variable type names can be selected 
  898. this way.  The primary intent for providing these commands is for their use in 
  899. macros, as such functionality is virtually mandatory in order for the macro 
  900. facility to be a useful tool.
  901.  
  902. Additionally, there is a ‘Next Token’ and a ‘Previous Token’ command.  These are 
  903. similar to the above, save that only those characters belonging to a token are 
  904. selected.  Play around with it, I'm not sure I can explain it right.
  905.  
  906.     /* Method Selection */
  907.  
  908. The last two commands of substance are the ‘Next Method’ and ‘Previous Method’ 
  909. commands.  When invoked, they both take note of the currently selected method 
  910. (the method that contains the insertion point or the beginning of an extended 
  911. selection).  ‘Next Method’ will scroll the window to display the next method 
  912. declared in the file and will hilight the method's name, ‘Previous Method’ will 
  913. display the previous method as declared in the file in much the same fashion.  
  914. If either command is invoked and there is no next or previous method 4Plus will 
  915. emit a beep, and if these commands were invoked via playback of a macro and no 
  916. next or previous method exists, the playback is aborted.
  917.  
  918. ‘Next Method’ and ‘Previous Method’ both make use of the same code to parse a 
  919. source file as the methods menu, as such, the limitations described above for 
  920. the method menu apply with these commands as well.  Additionally, the text 
  921. window in which either command is invoked must be a source file and be 
  922. appropriately named (*.c).
  923.  
  924.     /* Comment Selection */
  925.  
  926. Selects the comment containing the current selection range if such a comment 
  927. exists, otherwise it beeps.  Kind of like THINK C's “Balance” command.
  928.  
  929.     /* More Key Commands<I */
  930.  
  931. The remaining key commands don't really do anything you couldn't do before with 
  932. THINK C and can be divided into two groups, those that fill minor gaps in THINK 
  933. C's treatment of the extended ADB keyboard, and those that allow owners of non-
  934. ADB keyboards without arrow keys access to arrow key functionality.
  935.  
  936.         /* Home */
  937.  
  938. The ‘Home’ key command does what the Home key should do, it scrolls the current 
  939. document to it's 'home' position, without affecting the insertion point or 
  940. current selection range.  It is functionally equivalent to dragging the thumbs 
  941. on both scroll bars to the scroll bar's minimum setting.
  942.  
  943.         /* End */
  944.  
  945. The ‘End’ key command does what the End key should do, it scrolls the current 
  946. document to it's 'end' position, without affecting the insertion point or 
  947. current selection range.  It is functionally equivalent to dragging the thumb on 
  948. the vertical scroll bar to it's maximum setting.
  949.  
  950.         /* Page Up */
  951.  
  952. The ‘Page Up’ key command is the equivalent of clicking in the pageUp portion of 
  953. the vertical scroll bar.
  954.  
  955.         /* Page Down */
  956.  
  957. The ‘Page Down’ key command is the equivalent of clicking in the pageDown 
  958. portion of the vertical scroll bar.
  959.  
  960.         /* Scroll Up */
  961.  
  962. The ‘Scroll Up’ key command is the equivalent of clicking in the inUpArrow 
  963. portion of the vertical scroll bar.
  964.  
  965.         /* Scroll Down */
  966.  
  967. The ‘Scroll Down’ key command is the equivalent of clicking in the inDownArrow 
  968. portion of the vertical scroll bar.
  969.  
  970.         /* Forward Delete */
  971.  
  972. The ‘Forward Delete’ key command does a forward delete.  The character to the 
  973. right of the insertion point is deleted.  The ‘Forward Delete’ command works 
  974. exactly like a normal delete in the case of a selection spanning one or more 
  975. characters.
  976.  
  977.     /* Still More Key Commands */
  978.  
  979. The remaining key commands all duplicate THINK C's treatment of the arrow keys, 
  980. and are provided mainly for the benefit of those without arrow keys on their 
  981. keyboards.  The default assignments for these commands are essentially what the 
  982. assignments are within THINK C.  Users with arrow keys can deassign them if 
  983. desired, though you're not going to gain anything by doing so.  One possible use 
  984. might be to remap the option modified arrow key assignments to be invoked with 
  985. the command key instead, and use the option key in conjunction with the arrow 
  986. keys to perform the ‘Left Token’, ‘Right Token’, ‘Next Method’, and ‘Previous 
  987. Method’ commands.  This would bring the use of modified arrow keys in accordance 
  988. with the user interface guidelines as Apple has stated them.  I'm probably 
  989. reaching here, but that's the only use I can think of for ADB owners to use 
  990. these assignments.
  991.  
  992. /* Other Options */
  993.  
  994.     /* Update “rsrc.h” */
  995.  
  996. ‘Update "rsrc.h"’ may be of dubious utility, depending on how you deal with 
  997. resources in development.  When selected, 4Plus will attempt to locate the 
  998. project's resource file (the file whose name is that of the project's with 
  999. '.rsrc' appended to it).  If it finds such a resource file, it will then create 
  1000. a text file called "rsrc.h".  Then it will scan through the resource file, type 
  1001. by type, looking for all of the contained resources.  For each type, an enum 
  1002. statement listing all resources belonging to that type will be added to the text 
  1003. file.  If a resource has a name, that name will be used in the enumerator, 
  1004. otherwise 4Plus will name it _UNTITLED_n_, where n is the number of occurrences 
  1005. of such untitled resources up to that point. The value assigned to the 
  1006. enumerator will be the resource's id, and a comment will be appended to the 
  1007. statement indicating which attributes have been set for the resource.  If the 
  1008. file "rsrc.h" is open in it's own window, the window will be selected and 4Plus 
  1009. will issue a Revert command to THINK C so as to update the contents of the 
  1010. window to reflect the contents of the file.
  1011.  
  1012. The idea here is to allow you to create resources on the fly using ResEdit, name 
  1013. them using ResEdit, and update your code's references to the resources with a 
  1014. single menu selection.  Of course, the names you give to the resources should be 
  1015. valid in C - no spaces, pound signs and the like.
  1016.  
  1017. A feature/bug with the ‘Update "rsrc.h"’ command has to do with THINK C not 
  1018. knowing that the file has been changed.  This can be good, and this can be bad.  
  1019. It's good if all you're doing is adding a new resource - typically the only code 
  1020. that will need to be recompiled will be those files which refer to the resource, 
  1021. and those files are already marked to be recompiled by virtue of your having 
  1022. made the changes in them that deal with the resource.  If you're used to keeping 
  1023. all your equates that deal with resources in one file, and you deal in big 
  1024. projects, this is a good thing as it saves you from either rebuilding your 
  1025. entire project or manually deselecting those files that don't need to be 
  1026. recompiled.
  1027.  
  1028. It's not so good though in the situation wherein you change either the id or the 
  1029. name for a resource.  Here, you may have some files that really do need to be 
  1030. advised of the change relating to the resource, and of course, as THINK C 
  1031. doesn't know about the change in "rsrc.h", the chances are that the project will 
  1032. be out of date.  In this case, you'll need to manually advise THINK C of the 
  1033. change to the file, and that'll entail a trip to the Make dialog.
  1034.  
  1035. ‘Update “rsrc.h”’ will open the project's resource file read only, so it will 
  1036. not complain if the resource file is already open from some other application, 
  1037. like ResEdit.  However, this doesn't mean that the results obtained when 
  1038. performing ‘Update “rsrc.h”’ are necessarily valid in this case... if you made 
  1039. any name or ID changes in ResEdit and they haven't been saved, you and 4Plus 
  1040. will very likely not get wind of them.
  1041.  
  1042. You can change the specification for "rsrc.h" by observing that 'STR ' resource 
  1043. id 128 in the 4Plus file contains the string used as the file specification.  If 
  1044. 4Plus finds a ':' character within this string it will substitute the project 
  1045. name for the colon, though this is probably not a good idea if you've taken to 
  1046. naming your projects with a '.π' suffix.  4Plus sticks a #define _H_rsrc 
  1047. directive in rsrc.h - if it's #define _H_proj.π, THINK C will think you're 
  1048. defining _H_proj to be '.π', and in the case where you have some other header 
  1049. that's named 'proj.h' that might not be a good thing.  You don't need/want to 
  1050. include a '.h' in the string, 4Plus will do that automatically.  You can disable 
  1051. this feature altogether by simply deleting the resource.  I know that that will 
  1052. be the preference for some.
  1053.  
  1054.     /* Update “proj.π.rsrc” */
  1055.  
  1056. This command works in conjunction with the previous command, ‘Update “rsrc.h”’.  
  1057. ‘Update “proj.π.rsrc”’ is only active when the frontmost window has the same 
  1058. name as rsrc.h (or whatever file specification you've assigned).  It will 
  1059. reflect any changes you make in rsrc.h to proj.π.rsrc, which will be your 
  1060. project resource file.  The idea here is to create a header file listing all of 
  1061. your resources using ‘Update “rsrc.h”’, change any of the names, ID's, or 
  1062. attributes for those resources using THINK C's text editor, and then use ‘Update 
  1063. “proj.π.rsrc”’ to incorporate those changes back into the project's resource 
  1064. file.
  1065.  
  1066. When you perform a ‘Update “rsrc.h”’, 4Plus stores some information in the 
  1067. header file's resource fork relating to the resources contained in the project 
  1068. resource file.  This information is basically a list of all of the resource 
  1069. types contained in the project resource file, and for each type, a list of all 
  1070. resources with that type - it serves as a binary mirror of the information 
  1071. contained in the text file.  When doing a ‘Update “proj.π.rsrc”’, 4Plus will use 
  1072. this information to determine whether any significant changes have been made to 
  1073. the project's resource file since it was last parsed by 4Plus.  A significant 
  1074. change as far as 4Plus is concerned is one that affects the addition or deletion 
  1075. of a resource, or the change of a resource's id.  If no such changes are found, 
  1076. 4Plus will then compare the number of types and the number of resources for each 
  1077. type in the project resource file with the number of types and the number of 
  1078. resources declared for each type in the text file.  If there are still no 
  1079. discrepancies, 4Plus will then begin it's final pass over rsrc.h, obtaining each 
  1080. resource in the project resource file associated with each enumerator, and 
  1081. making any necessary changes to the resource's name, id, or attributes so as to 
  1082. make the project resource file reflect rsrc.h.  If any errors are encountered 
  1083. during this process, 4Plus calls the show off and instructs the Resource Manager 
  1084. to ignore any changes made to the project's resource file up to that point, thus 
  1085. rendering the resource file unchanged.
  1086.  
  1087. There are a few things to keep in mind when using this command.  First and 
  1088. foremost, MAKE A BACKUP OF YOUR PROJECT'S RESOURCE FILE BEFORE SUBJECTING IT TO 
  1089. 4PLUS!  Minor name changes and simple attribute twiddling is best performed from 
  1090. within ResEdit - I intended this feature only to be used in those instances 
  1091. where major resource map modifications were needed.
  1092.  
  1093. Secondly, know that 4Plus is reading those comments it inserts in the header 
  1094. file when you do a ‘Update “rsrc.h”’.  The resource types and the resource 
  1095. attributes are all detailed via comments so that the header file won't get 
  1096. barfed on by the compiler.  Of course, you'll be wanting to change the attribute 
  1097. comments every so often, but leave the type comments alone.  4Plus ignores white 
  1098. space in it's parse, but it fully expects the resource type to be delimited by 
  1099. single quotes.  The format for the attribute comments is considerably more 
  1100. relaxed, 4Plus is just looking for strings like resPurgeable, resPreload, etc.  
  1101. It doesn't care what surrounds it.
  1102.  
  1103. Third, don't change the order in which the resources are listed within a enum 
  1104. statement.  You can change the order in which the statements (types) themselves 
  1105. occur (why?), but don't reverse or reorder the individual enumerators unless 
  1106. that is what you really want to do.  It's OK to swap the id's on two or more 
  1107. resources within a type, as 4Plus references each resource based on the order in 
  1108. which they occur both in the resource file's reference map as well as within the 
  1109. text file itself.
  1110.  
  1111. Here's an example that I hope will make everything clear.
  1112.  
  1113. This is how a portion of rsrc.h looks right after we perform an ‘Update 
  1114. “rsrc.h”’...
  1115.  
  1116.         /* 'DLOG' */
  1117.  
  1118.         enum {
  1119.             DAFFY_DLOG_ID = 128,        /* resPurgeable */
  1120.             GOOFY_DLOG_ID,            /* resPurgeable */
  1121.             DOPEY_DLOG_ID,
  1122.             _UNTITLED_1_                /* resSysHeap */
  1123.             };
  1124.  
  1125. This is how that very same portion would look after some simple changes...
  1126.  
  1127.         /* 'DLOG' */
  1128.  
  1129.         enum {
  1130.             DAFFY_DLOG_ID = 128,        /* resPurgeable */
  1131.             WIMPY_DLOG_ID,            /* resPurgeable */
  1132.             DOPEY_DLOG_ID = 131,        /* resPurgeable */
  1133.             _UNTITLED_1_                /* resPurgeable */
  1134.             };
  1135.  
  1136. Note that we have changed the name of 'DLOG' #129 to WIMPY_DLOG_ID, and that all 
  1137. of the resources have been marked as purgeable.  Note also that by adding the 
  1138. explicit enumerator assignment of 131 for DOPEY_DLOG_ID, we have effectively 
  1139. renumbered both that and the next resource to 131 and 132, respectively.  4Plus 
  1140. will handle instances where a newly assigned resource ID conflicts with an 
  1141. already assigned ID - in this case 4Plus renumbered _UNTITLED_1_ before 
  1142. DOPEY_DLOG_ID so as to free up the id slot.  Note that 4Plus will not touch the 
  1143. name for a resource if the enumerator token is _UNTITLED_n_.  
  1144.  
  1145. 4Plus performs a very limited parse on the resource header file.  It will 
  1146. correctly handle the enum statements, and it will correct handle the comments.  
  1147. Everything/anything else that you might throw in there 4Plus will ignore.  One 
  1148. thing that you might be tempted to do is to set up yet another header file which 
  1149. is to be included within the resource header file and which contains a set of 
  1150. base id #defines to be used with the enum statements.  4Plus won't let you do 
  1151. that.  But maybe soon.
  1152.  
  1153.     /* Color Hilighting */
  1154.  
  1155. The next option to be touched on is the ‘Color Hilighting’ option.  This is very 
  1156. simple, it simply provides users of color monitors the ability to substitute the 
  1157. default hilight color for the plain inversion THINK C performs when selecting 
  1158. text.
  1159.  
  1160.     /* The Power Thumb */
  1161.  
  1162. The next option is the ‘Power Thumb’.  I like this one, and it should be a hit 
  1163. with users of large screens and fast CPU's.  The ‘Power Thumb’ actually scrolls 
  1164. the document while you drag on the thumb (the thumb is sometimes referred to as 
  1165. the elevator box I guess, it's the little box inside a scroll bar that goes up 
  1166. and down).  No grey outlines, no guessing where you should release the thumb, 
  1167. just grab it and watch the text fly by.  Depressing the option key while you use 
  1168. the thumb causes it to behave as usual.  Deselecting the option reverses it, 
  1169. that is, the thumb behaves normally unless you use it with the option key 
  1170. depressed, then you get the ‘Power Thumb’ effect.
  1171.  
  1172.     /* Prompt Keystroke */
  1173.  
  1174. This last option just lets you control whether or not you get a little window 
  1175. displayed prompting you to enter a keystroke for those commands that expect one 
  1176. (i.e. macro assignment, examining assignments, saving searches, etc.)
  1177.  
  1178.     /* Grep Menus */
  1179.  
  1180. Within THINK C's Find dialog box are two popup menus that are active only when 
  1181. the grep option is turned on.  One menu for search strings, one for replace 
  1182. strings.  Every time you enter a search or replace string in GREP mode, the 
  1183. string is added to the menu.  Choosing a string from the menu enters that string 
  1184. as the string to be searched on or replaced.  The menus are sorted according to 
  1185. the frequency with which the string is used, and are saved and restored at 
  1186. application exit/launch.  Especially handy with those hard to remember GREP 
  1187. strings.  To delete an item in one of the menus, option-click select it.
  1188.  
  1189.     /* Version Territory */
  1190.  
  1191. 4Plus will allow you to create, modify or delete 'vers' resources contained in 
  1192. your project's resource file.  Choosing the item “Version Territory” will 
  1193. present you with a dialog in which any necessary changes can be made.  It is 
  1194. assumed that you know what a 'vers' resource is.  The four controls at the top 
  1195. of the dialog allow you to change the version number, the two popup menus let 
  1196. you change the stage and country fields of the resource, and the editText item 
  1197. allows you to enter the message.  Note that the editText item is exactly the 
  1198. same size as the statText field the Finder uses to display the message for 
  1199. 'vers' 1 resources, and that 4Plus uses the same font as the Finder.  The 
  1200. version string is displayed in a statText item... it reflects any of the changes 
  1201. to the version number made using the controls or stage menu and cannot be 
  1202. directly edited (though if you click on it, the version number will replace the 
  1203. text selected within the message editText field).  The two control pairs at the 
  1204. top right of the dialog allow you to add or delete 'vers' resources 1 or 2, and 
  1205. to choose which of the two are to be edited.
  1206.  
  1207. The check box labeled “autoBump” controls whether 4Plus will increment the 
  1208. version number contained in 'vers' ID 1 every time you do a “Build 
  1209. Application/Code Resource/etc.”.  If checked, 4Plus will detect when you are 
  1210. actually about to build your application.  When you do, 4Plus will load in the 
  1211. 'vers' resource, add 1 to the nonRelRev field and update both the version and 
  1212. message strings so as to reflect the new version number.  The version string is 
  1213. simply created from scratch - the message string is treated differently.  4Plus 
  1214. will look for an instance of the old version string within the message string, 
  1215. and if it finds such an instance it will replace the old string with the new 
  1216. version string (a la Munger).  Note that the string to be replaced needs to be 
  1217. exactly identical to the old version string.
  1218.  
  1219. 4Plus detects a application/code resource/etc. build when the SFPPutFile dialog 
  1220. box for building applications/code resources/etc. is displayed.  So the version 
  1221. number doesn't get bumped in those instances where a build couldn't be completed 
  1222. due to problems with your code.  However, it does mean that the version number 
  1223. will get bumped regardless of what you do with the SFPPutFile dialog... 
  1224. cancelling the build by clicking the Cancel button won't make any difference - 
  1225. you'll still get bumped.
  1226.  
  1227.  
  1228. /* About This INIT <I */
  1229.  
  1230. Before I wrap it up, some notes about 4Plus, the INIT.  It basically consists of 
  1231. two portions, a little nub that hangs out in the system heap and the main code 
  1232. that resides within THINK C's heap.  The nub takes up about 1K.  It's job is 
  1233. just to sense when THINK C has been launched.  When it is, it loads the main 
  1234. code into THINK C's heap, moves it to the top of the heap, and locks it.  The 
  1235. main code is a little under 30K in size.  Other code, such as for the 
  1236. configuration dialog, or for the ‘About 4Plus…’ item, are loaded as needed and 
  1237. discarded when no longer needed.
  1238.  
  1239. There are three benefits to this approach.  First, you're not wasting any space 
  1240. in the system heap when 4Plus is installed and you're not using THINK C.  
  1241. Secondly, it should be obvious that I've patched a few traps to get this thing 
  1242. to run.  The vast majority of these patches are made within THINK C's heap, 
  1243. thus, when running under MultiFinder, the patches are swapped out with a context 
  1244. switch thereby ensuring that 4Plus won't muck up any other applications (in 
  1245. theory).  And lastly, because the patches are made when THINK C is launched, 
  1246. 4Plus gets the first shot at intercepting the relevant trap calls, thus ensuring 
  1247. compatibility with the various other INIT's, cdev's and the like.  Or, at least 
  1248. that's the way it should be.
  1249.  
  1250. Because 4Plus allocates memory in THINK C's heap, it might be a good idea to 
  1251. bump up THINK C's partition size a bit.  This depends on your project size, most 
  1252. users probably shouldn't be concerned.  THINK C does a good job with memory 
  1253. management and will let you know if things are getting hairy.
  1254.  
  1255. Users of anti-viral programs released as INIT's and cdev's may have to take 
  1256. steps to accommodate 4Plus... if you have the option to specify privileges for 
  1257. programs on a program by program basis, do so for 4Plus.  Otherwise just rename 
  1258. 4Plus so that it loads before the anti-viral program.
  1259.  
  1260. 4Plus looks for a THINK C launch by looking at the name of each launched 
  1261. application.  Yes, I know there are other, more elegant ways of doing this, but 
  1262. they were causing problems with the source code debugger, and besides, they take 
  1263. up more CPU time/resources.  As it is now, THINK C should be called THINK C.  
  1264. If, for some bizarre reason, THINK C is not called THINK C on your system, then 
  1265. you can observe that 4Plus looks at the 'STR ' #129 resource to determine what 
  1266. the name for THINK C is.
  1267.  
  1268.  
  1269. /* PLEASE SUPPORT SHAREWARE<B<O */
  1270.  
  1271. Registration entails that you send me a check or money order for $40.  Site 
  1272. licenses can be had for a paltry $110.  If you're not in the United States and 
  1273. you want me to send you a disk, please add an additional amount so as to cover 
  1274. shipping expenses... I'd tell you how much if I knew where you are.
  1275.  
  1276. You'll want to make the check or money order payable to Donald Way.
  1277.  
  1278. You'll want to send the check or money order to...
  1279.  
  1280. Donald Way
  1281. 109 4th Street
  1282. Hoboken, NJ  07030
  1283.  
  1284.  
  1285.  
  1286. THINK C is a trademark of Symantec and is easily the best development system 
  1287. available.
  1288.  
  1289. And getting better all the time :)
  1290.